import { ref } from 'vue';
import useDataLoad from '@/hooks/useDataLoad.ts';
import { getCaseORderList } from "@/api/index"
export default function useOrder() {
	const dataLoad = useDataLoad(getCaseORderList);
	// 当前订单列表状态
	const currentTab = ref(0);
	const tabs = ref(['全部案件', '待服务', '服务中', '已完成',]);
	const tabsChange = ({ index, name }) => {
		currentTab.value = index;
		dataLoad.setParams({
			status: currentTab.value
		});
		dataLoad.reGetData();
	};
	dataLoad.setParams({
		status: currentTab.value
	});
	return {
		currentTab,
		tabsChange,
		tabs,
		...dataLoad
	};
}